﻿<UserControl x:Class="Crumble.CrumbleCore"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="25" />
            </Grid.RowDefinitions>
            <TabControl Name="FilterTabControl" ItemsSource="{Binding}" Margin="2,2,2,5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                <TabControl.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding (DisplayName)}"/>
                    </DataTemplate>
                </TabControl.ItemTemplate>
                <TabControl.ContentTemplate>
                    <DataTemplate>
                        <ScrollViewer HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto">
                            <UserControl Content="{Binding (FilterUserControl)}"/>
                        </ScrollViewer>
                    </DataTemplate>
                </TabControl.ContentTemplate>
            </TabControl>
            <Grid Grid.Row="1">
                <Button Content="Execute Report" Height="24" HorizontalAlignment="Left" VerticalAlignment="Top" Width="125" Click="Click_ProcessReport" />
            </Grid>
        </Grid>
        <Grid Column="1" Name="ReportViewerGrid" Width="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <WindowsFormsHost>
                <rv:ReportViewer x:Name="ReportViewerControl"/>
            </WindowsFormsHost>
        </Grid>
    </Grid>
</UserControl>
